home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Games / Game Sample Code / ZAM 1.0a13 / GameSource / FixGraf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-16  |  664 b   |  41 lines  |  [TEXT/KAHL]

  1. #include "FixGraf.h"
  2.  
  3.  
  4. void    FixRectToRect(fixRect *fr, Rect *r)
  5. {
  6.     r->top = FixToInt(fr->top);
  7.     r->left = FixToInt(fr->left);
  8.     r->bottom = FixToInt(fr->bottom);
  9.     r->right = FixToInt(fr->right);
  10. }
  11.  
  12. void    RectToFixRect( Rect *r, fixRect *fr)
  13. {
  14.     fr->top = ff(r->top);
  15.     fr->left = ff(r->left);
  16.     fr->bottom = ff(r->bottom);
  17.     fr->right = ff(r->right);
  18. }
  19.  
  20.  
  21. void    PointToFixPoint( Point *p, fixPt *fp)
  22. {
  23.     fp->h = ff(p->h);
  24.     fp->v = ff(p->v);
  25. }
  26.  
  27.  
  28. void    FixPointToPoint(  fixPt *fp, Point *p)
  29. {
  30.     p->h = FixToInt(fp->h);
  31.     p->v = FixToInt(fp->v);
  32. }
  33.  
  34. void    OffsetFixRect(fixRect *fr, fixPt *fp)
  35. {
  36.     fr->top += fp->v;
  37.     fr->left += fp->h;
  38.     fr->bottom += fp->v;
  39.     fr->right += fp->h;
  40. }
  41.